type IDType = number | string;

type res = number extends IDType ? true : false;

// 函数重载
function sum<T extends number | string>(
  num1: T,
  num2: T
): T extends number ? number : string;

function sum(num1, num2) {
  return num1 + num2;
}

const res = sum<number>(30, 20);

export {};
